package com.j4dream.property.web;

import com.j4dream.property.dao.AdminDao;
import com.j4dream.property.model.UserDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin")
public class Admin {

    @Autowired
    private AdminDao adminDao;

    @GetMapping("recent-save")
    public String recentSave() {

        return "Recent Save List";
    }

    @PostMapping("post")
    public String savePost() {
        return "save";
    }

    @PutMapping("post")
    public void updatePost() {

    }

    @DeleteMapping("post")
    public void delPost() {

    }


    @GetMapping("user")
    public void user() {
        UserDto user = new UserDto();
        user.setEmail("dream@email.com");
        adminDao.insertUser(user);
    }

    @PostMapping("login")
    public String login() {
        return "login";
    }

}
